<?php

use yii\db\Migration;

/**
 * Handles the creation of table `address`.
 */
class m170409_103253_create_address_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('address', [
            'id' => $this->primaryKey(),
            'member_id'=>$this->integer()->notNull()->comment('会员id'),
            'username'=>$this->string(50)->notNull()->comment('收货人'),
             'province_name'=>$this->string(30)->notNull()->comment('省份'),
            'city_name'=>$this->string(30)->notNull()->comment('城市'),
            'area_naem'=>$this->string(30)->notNull()->comment('区域'),
            'detail_address'=>$this->string(50)->notNull()->comment('详细地址'),
            'mobilephone'=>$this->char(12)->notNull()->comment('手机号码'),
            'status'=>$this->integer(3)->comment('状态1默认地址0正常-1删除状态'),
            'created_at'=>$this->integer()->comment('添加时间'),
            'updated_at'=>$this->integer()->comment('更新时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('address');
    }
}
